home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 037a / sebhash.zip / RTEXT.PAS < prev    next >
Pascal/Delphi Source File  |  1991-10-04  |  880b  |  40 lines

  1. Program RandText;
  2.  
  3.  
  4. Uses Crt;
  5.  
  6. Var
  7.   Outfile : text;
  8.   TotLines, I, J, Line_Width : Integer;
  9.   CaseTog : Integer;
  10.   Lin, Nst, Fna : String;
  11.   Tch : Char;
  12.  
  13. Begin
  14.   Write('Number of text lines to make --> ');
  15.   readln(TotLines);
  16.   Write('Width of each text line (>1 and <255) --> ');
  17.   Readln(Line_Width);
  18.   Write('Name of output file --> ');
  19.   readln(Fna);
  20.   WriteLn;
  21.   WriteLn('Creating and writing ',Fna);
  22.   Assign(Outfile,Fna);
  23.   Rewrite(Outfile);
  24.   Str(TotLines,Nst);
  25.   WriteLn(Outfile,Nst);
  26.   For I := 1 to TotLines do
  27.     begin
  28.       Lin := '';
  29.       For J := 1 to Line_Width do
  30.         begin
  31.           CaseTog := Random(2);
  32.           Tch := Chr(Random(26) + ((1-CaseTog)*65) + (CaseTog*97) );
  33.           Lin := Lin + Tch;
  34.         end;
  35.       Writeln(Outfile,Lin);
  36.       Write(I,' lines written',chr(13));
  37.     end;
  38.   Close(Outfile);
  39. End.
  40.